package com.dkm.biz.gl.repository.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.dkm.base.core.helper.SpringHelper;
import com.dkm.base.db.persistence.dao.IQueryDao;
import com.dkm.biz.gl.domain.EavSetGroup;
import com.dkm.biz.gl.persistence.dao.EavSetGroupQueryDao;
import com.dkm.biz.gl.persistence.entity.EavSetGroupPo;
import com.dkm.biz.gl.repository.EavSetGroupRepository;
import com.dkm.biz.repository.AbstractRepository;

/**
 * 对象功能:属性分组 Repository接口的实现类
 * 开发公司:dkm.com
 * 开发人员:ZHH
 * 创建时间:2017-05-09 17:30:32
 */
@Repository
public class EavSetGroupRepositoryImpl extends AbstractRepository<String, EavSetGroupPo,EavSetGroup> implements EavSetGroupRepository{
	  
	@Resource
	private  EavSetGroupQueryDao eavSetGroupQueryDao;

	public EavSetGroup newInstance() {
		EavSetGroupPo po = new EavSetGroupPo();
		EavSetGroup eavSetGroup = SpringHelper.getBean(EavSetGroup.class);
		eavSetGroup.setData(po);
		return eavSetGroup;
	}

	public EavSetGroup newInstance(EavSetGroupPo po) {
		EavSetGroup eavSetGroup = SpringHelper.getBean(EavSetGroup.class);
		eavSetGroup.setData(po);
		return eavSetGroup;
	} 
	
	@Override
	protected IQueryDao<String, EavSetGroupPo> getQueryDao() {
		return eavSetGroupQueryDao;
	}
	@Override
	public List<EavSetGroupPo> findBySetId(String setId) {
		 Map<String,Object> params = new HashMap<String,Object>();
		 params.put("setId",setId);
		 return  eavSetGroupQueryDao.findByKey("findBySetId", params);
	}
}
